home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
archivers
/
xfd
/
developer
/
include
/
amigae
/
emodules
/
libraries
/
xfdmaster.e
next >
Wrap
Text File
|
1999-05-17
|
23KB
|
496 lines
/*
** $VER: xfdmaster.h 38.4 (02.11.98)
**
** Copyright © 1994-98 by Georg Hörmann, Dirk Stöcker
** All Rights Reserved.
**
** Translated to E by Sven Steiniger.
*/
OPT MODULE
OPT PREPROCESS
OPT EXPORT
MODULE 'exec/libraries', 'exec/execbase',
'dos/dosextens'
/*********************
* *
* Library Base *
* *
*********************/
OBJECT xfdMasterBase
libNode:lib
xfdm_SegList:LONG /* PRIVATE! */
xfdm_DosBase:PTR TO doslibrary /* May be used for I/O etc. */
xfdm_FirstSlave:PTR TO xfdSlave /* List of available slaves */
xfdm_FirstForeMan:PTR TO xfdForeMan /* PRIVATE! */
xfdm_MinBufferSize:LONG /* (V36) Min. BufSize for xfdRecogBuffer() */
xfdm_MinLinkerSize:LONG /* (V36) Min. BufSize for xfdRecogLinker() */
xfdm_ExecBase:PTR TO execbase /* (V38.2) Cached for fast access */
ENDOBJECT
CONST XFDM_VERSION = 38 /* for OpenLibrary() */
#define XFDM_NAME 'xfdmaster.library'
/***************************
* *
* Object Types (V36) *
* *
***************************/
CONST XFDOBJ_BUFFERINFO = 1 /* xfdBufferInfo structure */
CONST XFDOBJ_SEGMENTINFO = 2 /* xfdSegmentInfo structure */
CONST XFDOBJ_LINKERINFO = 3 /* xfdLinkerInfo structure */
CONST XFDOBJ_SCANNODE = 4 /* (V37) xfdScanNode structure */
CONST XFDOBJ_SCANHOOK = 5 /* (V37) xfdScanHook structure */
CONST XFDOBJ_MAX = 5 /* PRIVATE! */
/********************
* *
* Buffer Info *
* *
********************/
OBJECT xfdBufferInfo
xfdbi_SourceBuffer:PTR TO CHAR /* Pointer to source buffer */
xfdbi_SourceBufLen:LONG /* Length of source buffer */
xfdbi_Slave:PTR TO xfdSlave /* PRIVATE! */
xfdbi_PackerName:PTR TO CHAR /* Name of recognized packer */
xfdbi_PackerFlags:INT /* Flags for recognized packer */
xfdbi_Error:INT /* Error return code */
xfdbi_TargetBuffer:PTR TO CHAR /* Pointer to target buffer */
xfdbi_TargetBufMemType:LONG /* Memtype of target buffer */
xfdbi_TargetBufLen:LONG /* Full length of buffer */
xfdbi_TargetBufSaveLen:LONG /* Used length of buffer */
xfdbi_DecrAddress:LONG /* Address to load decrunched file */
xfdbi_JmpAddress:LONG /* Address to jump in file */
xfdbi_Special:PTR TO CHAR /* Special decrunch info (eg. password) */
xfdbi_Flags:INT /* (V37) Flags to influence recog/decr */
xfdbi_Reserved0:INT /* (V38) PRIVATE! */
xfdbi_MinTargetLen:LONG /* (V38) Required length of target buffer */
xfdbi_FinalTargetLen:LONG /* (V38) Final length of decrunched file */
xfdbi_UserTargetBuf:PTR TO CHAR /* (V38) Target buffer allocated by user */
xfdbi_UserTargetBufLen:LONG /* (V38) Target buffer length */
ENDOBJECT
/* Max. length of special info */
#define xfdbi_MaxSpecialLen xfdbi_Error
/*********************
* *
* Segment Info *
* *
*********************/
OBJECT xfdSegmentInfo
xfdsi_SegList:LONG /* BPTR to segment list */
xfdsi_Slave:PTR TO xfdSlave /* PRIVATE! */
xfdsi_PackerName:PTR TO CHAR /* Name of recognized packer */
xfdsi_PackerFlags:INT /* Flags for recognized packer */
xfdsi_Error:INT /* Error return code */
xfdsi_Special:PTR TO CHAR /* Special decrunch info (eg. password) */
xfdsi_RelMode:INT /* (V34) Relocation mode */
xfdsi_Flags:INT /* (V37) Flags to influence recog/decr */
ENDOBJECT
/* Max. length of special info */
#define xfdsi_MaxSpecialLen xfdsi_Error
/**************************
* *
* Linker Info (V36) *
* *
**************************/
OBJECT xfdLinkerInfo
xfdli_Buffer:PTR TO CHAR /* Pointer to buffer */
xfdli_BufLen:LONG /* Length of buffer */
xfdli_LinkerName:PTR TO CHAR /* Name of recognized linker */
xfdli_Unlink:PTR TO CHAR /* PRIVATE! */
xfdli_Reserved:INT /* Set to NULL */
xfdli_Error:INT /* Error return code */
xfdli_Hunk1:LONG /* PRIVATE! */
xfdli_Hunk2:LONG /* PRIVATE! */
xfdli_Amount1:LONG /* PRIVATE! */
xfdli_Amount2:LONG /* PRIVATE! */
xfdli_Save1:PTR TO CHAR /* Pointer to first unlinked file */
xfdli_Save2:PTR TO CHAR /* Pointer to second unlinked file */
xfdli_SaveLen1:LONG /* Length of first unlinked file */
xfdli_SaveLen2:LONG /* Length of second unlinked file */
ENDOBJECT
/************************
* *
* Scan Node (V37) *
* *
************************/
OBJECT xfdScanNode
xfdsn_Next:PTR TO xfdScanNode /* Pointer to next xfdScanNode or NULL */
xfdsn_Save:PTR TO CHAR /* Pointer to data */
xfdsn_SaveLen:LONG /* Length of data */
xfdsn_PackerName:PTR TO CHAR /* Name of recognized packer */
xfdsn_PackerFlags:INT /* Flags for recognized packer */
ENDOBJECT
/************************
* *
* Scan Hook (V37) *
* *
************************/
OBJECT xfdScanHook
xfdsh_Entry:LONG /* Entrypoint of hook code (BOOL (*)()) */
xfdsh_Data:PTR TO CHAR /* Private data of hook */
xfdsh_ToDo:LONG /* Bytes still to scan (READ ONLY) */
xfdsh_ScanNode:LONG /* Found data right now (or NULL) (READ ONLY) */
ENDOBJECT
/********************
* *
* Error Codes *
* *
********************/
CONST XFDERR_OK = $0000 /* No errors */
CONST XFDERR_NOMEMORY = $0001 /* Error allocating memory */
CONST XFDERR_NOSLAVE = $0002 /* No slave entry in info structure */
CONST XFDERR_NOTSUPPORTED = $0003 /* Slave doesn't support called function */
CONST XFDERR_UNKNOWN = $0004 /* Unknown file */
CONST XFDERR_NOSOURCE = $0005 /* No sourcebuffer/seglist specified */
CONST XFDERR_WRONGPASSWORD = $0006 /* Wrong password for decrunching */
CONST XFDERR_BADHUNK = $0007 /* Bad hunk structure */
CONST XFDERR_CORRUPTEDDATA = $0008 /* Crunched data is corrupted */
CONST XFDERR_MISSINGRESOURCE = $0009 /* (V34) Missing resource (eg. library) */
CONST XFDERR_WRONGKEY = $000a /* (V35) Wrong 16/32 bit key */
CONST XFDERR_BETTERCPU = $000b /* (V37) Better CPU required */
CONST XFDERR_HOOKBREAK = $000c /* (V37) Hook caused break */
CONST XFDERR_DOSERROR = $000d /* (V37) Dos error */
CONST XFDERR_NOTARGET = $000e /* (V38) No user target given */
CONST XFDERR_TARGETTOOSMALL = $000f /* (V38) User target is too small */
CONST XFDERR_TARGETNOTSUPPORTED = $0010 /* (V38) User target not supported */
CONST XFDERR_UNDEFINEDHUNK = $1000 /* (V34) Undefined hunk type */
CONST XFDERR_NOHUNKHEADER = $1001 /* (V34) File is not executable */
CONST XFDERR_BADEXTTYPE = $1002 /* (V34) Bad hunk_ext type */
CONST XFDERR_BUFFERTRUNCATED = $1003 /* (V34) Unexpected end of file */
CONST XFDERR_WRONGHUNKAMOUNT = $1004 /* (V34) Wrong amount of hunks */
CONST XFDERR_NOOVERLAYS = $1005 /* (V36) Overlays not allowed */
CONST XFDERR_UNSUPPORTEDHUNK = $2000 /* (V34) Hunk type not supported */
CONST XFDERR_BADRELMODE = $2001 /* (V34) Unknown XFDREL_#? mode */
/